import React,{useEffect, useState} from 'react'
import { useNavigate,Outlet } from 'react-router-dom'
import './shoucang.css'
export default function Shoucang() {
  const [flag,setflag]=useState(false)
  
  const [flag2,setflag2]=useState(false)
  const dianyi=()=>{
    navigate('/app/my/shouc/ctai')
    setflag(true)
   
    setflag2(false)
  }

  useEffect(()=>{
    dianyi()
  },[])
  const diansan=()=>{
    navigate('/app/my/shouc/cyiqi')
    setflag(false)

    setflag2(true)
  }
  const navigate = useNavigate()
  return (
    <div>
     <div className='sc-head'>
      <span className='sc-fan' onClick={()=>{navigate('/app/my')}}>&lt;</span>
      <p className='sc-zi'>我的收藏</p>
     </div>
     <div className='sc-main'>
     <span onClick={()=>{dianyi()}} className={flag?'sp_b':''}>动态</span>
         
          <span onClick={()=>{diansan()}} className={flag2?'sp_b2':''}>一起跑</span>
     </div>
     <div>
      <Outlet></Outlet>
     </div>
    </div>
  )
}
